Skip to content

feat(infrastructure): add Azure deployment foundations - #196

Merged
weastler merged 6 commits into
build/hub/newfrom
weastler-azure-deployment-foundations
Nov 12, 2026
Merged

weastler merged 6 commits into
build/hub/newfrom
weastler-azure-deployment-foundations

Conversation

@weastler

@weastler weastler commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

The Azure installation wizard needs reusable provisioning and release foundations that operators can also use without the wizard. This PR separates those foundations from the guided installation flow so they can be reviewed independently.

What changes

Adds optional Terraform modules for an installation-owned container registry and Key Vault, and a temporary private-network job that provisions fresh database roles. Each module has its own state and lifecycle. The main installation exposes authoritative resource IDs, supports an explicit deployment storage grant, and retains Azure-assigned properties without ignoring other configuration drift.

Native release commands validate revision metadata, drain active and inactive replicas before setup, avoid reactivating an already-active revision, and accept empty output from successful Azure mutations. Command failures identify the operation without exposing private tool output. The shared shutdown suite runs directly in Node.js, and the pure command-label helper has no installer runtime dependency. Terraform checks cover all three modules on both matrix versions; no wizard job or entry point is introduced here.

The Hub image can resolve locked dependencies through an explicit npm proxy and prune runtime dependencies offline. Deployment guidance preserves the current GitHub sign-in and administrator-enrollment behavior while documenting manual configuration rather than promising a runnable wizard.

Live Azure release, recovery, and proxy-backed Docker builds remain unverified. Existing Linux-only artifact filesystem tests fail on macOS before exercising storage; their code and tests are unchanged.

@weastler
weastler requested review from a team and nshki as code owners November 6, 2026 18:18
Copilot AI dynamic review requested due to automatic review settings November 6, 2026 18:18
@weastler
weastler added this pull request to stack #199 November 6, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Shutdown omits inactive revisions that may still have terminating replicas, allowing setup to proceed before those replicas have stopped.

9 open issues
3 files not reviewed
  • infrastructure/azure/.terraform.lock.hcl: Generated file
  • infrastructure/azure/foundation/.terraform.lock.hcl: Generated file
  • infrastructure/azure/provision/.terraform.lock.hcl: Generated file
What changed in this PR

Adds reusable Azure deployment foundations for Hub, supporting manual operation and a future installation wizard without introducing a wizard entry point.

Changes:

  • Adds separate-state registry, Key Vault, and temporary database-role provisioning modules.
  • Refactors release shutdown and adds revision validation, safe diagnostics, authoritative resource IDs, and targeted drift handling.
  • Expands infrastructure checks and supports npm-proxy image builds with offline dependency pruning.
File Description
infrastructure/​README.md Documents optional modules, access requirements, and release behavior.
infrastructure/​installer/​command/​describe/​index.ts Adds fixed, argument-free command labels.
infrastructure/​azure/​versions.tf Broadens the supported Terraform version range.
infrastructure/​azure/​variables.tf Adds an optional installation resource-group name.
infrastructure/​azure/​tests/​fixtures/​azure-assigned/​main.tf Seeds Azure-assigned properties for rerun tests.
infrastructure/​azure/​tests/​deployment.tftest.hcl Covers resource IDs, networking, and drift preservation.
infrastructure/​azure/​storage.tf Orders containers after the optional deployment grant.
infrastructure/​azure/​stop-hub/​index.ts Extracts revision validation, deactivation, and replica draining.
infrastructure/​azure/​stop-hub/​index.test.ts Covers shutdown ordering, responses, failures, and deadlines.
infrastructure/​azure/​provision/​tests/​provision.tftest.hcl Checks provisioning-job isolation and secret references.
infrastructure/​azure/​provision/​main.tf Adds the temporary database-role provisioning module.
infrastructure/​azure/​provision/​.terraform.lock.hcl Locks the provisioning module’s AzureRM provider.
infrastructure/​azure/​outputs.tf Exposes authoritative installation resource IDs.
infrastructure/​azure/​networking.tf Adds the database subnet’s Storage service endpoint.
infrastructure/​azure/​main.tf Uses the optional resource-group name.
infrastructure/​azure/​foundation/​tests/​foundation.tftest.hcl Checks registry, vault, and deployment-access settings.
infrastructure/​azure/​foundation/​main.tf Adds installation-owned registry and Key Vault resources.
infrastructure/​azure/​foundation/​.terraform.lock.hcl Locks the foundation module’s AzureRM provider.
infrastructure/​azure/​environment.tf Preserves Azure’s infrastructure resource-group assignment.
infrastructure/​azure/​deployment-access.tf Adds an opt-in deployment storage grant.
infrastructure/​azure/​deploy-hub/​index.ts Integrates shared shutdown and refines release diagnostics and activation.
infrastructure/​azure/​deploy-hub/​index.test.ts Extends release, activation, redaction, and teardown coverage.
infrastructure/​azure/​database.tf Preserves the Azure-assigned PostgreSQL zone.
infrastructure/​azure/​.terraform.lock.hcl Adds an AzureRM provider checksum.
infrastructure/​.gitignore Ignores local dependency and working directories.
hub/​script/​check-image/​index.ts Validates and forwards the npm registry build argument.
hub/​docs/​deployment.md Documents proxy-backed image builds.
hub/​Dockerfile Adds proxy-based dependency installation and offline runtime pruning.
.github/​workflows/​hub-infrastructure.yml Checks all Terraform modules across both matrix versions and runs shutdown tests.

Review effort: Max (auto)

Comment thread infrastructure/azure/stop-hub/index.ts Resolved
Comment thread infrastructure/azure/provision/main.tf Resolved
Comment thread infrastructure/azure/provision/main.tf Resolved
Comment thread infrastructure/azure/stop-hub/index.ts Resolved
Comment thread hub/docs/deployment.md Resolved
Comment thread infrastructure/README.md Resolved
@weastler
weastler force-pushed the weastler-azure-deployment-foundations branch from b161744 to 8882e83 Compare November 10, 2026 22:06
@weastler
weastler force-pushed the weastler-azure-deployment-foundations branch from 8882e83 to 5fec7b5 Compare November 12, 2026 18:03
@weastler
weastler removed this pull request from stack #199 November 12, 2026 20:49
@weastler
weastler added this pull request to stack #233 November 12, 2026 20:50
weastler and others added 6 commits November 12, 2026 14:21
Add optional registry/vault and private-network provisioning modules, native release safety gates, and proxy-backed image builds. Preserve the latest Hub admission and session configuration in deployment guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Record the signed linux_amd64 provider checksum in both optional module locks so readonly initialization remains valid for subsequent validation and mocked tests on CI runners.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Inspect inactive revisions as well as active ones, accept completed drains at the deadline, and resolve sensitive plan paths like Terraform after -chdir. Add independent native regression and safe-command-label coverage to CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject provisioning secret URLs outside the configured vault and allow public digest images without ACR authentication. Cover secret isolation, optional pull grants, and authenticated deployment storage access using mocked Terraform tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document registry and vault provider registration, optional provisioning registry access, and Terraform-relative plan placement. Direct operators to their approved npm proxy rather than a company-specific feed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@weastler
weastler force-pushed the weastler-azure-deployment-foundations branch from ec56c88 to c3a9133 Compare November 12, 2026 22:21
@weastler
weastler merged commit dd2cbe1 into build/hub/new Nov 12, 2026
47 checks passed
@weastler
weastler deleted the weastler-azure-deployment-foundations branch November 12, 2026 22:28
weastler added a commit that referenced this pull request Nov 12, 2026
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->

## Why

<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->

Operators need a guided way to install and update Hub without losing
saved answers, bypassing maintenance safeguards, or guessing whether a
failed deployment completed. This PR builds on #196 and keeps the
deployment engine and terminal interface together as one runnable flow.
The reusable design gallery follows in a separate PR.

## What changes

<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting this
description. -->
<!-- For UI changes, prune obsolete and duplicate stories in the
affected catalogues as part of the change. Explain removed UI or
consolidated coverage where needed; see
hub/docs/storybook.md#ui-changes-and-pull-request-evidence. -->

`npm run setup:server` opens an Azure wizard with searchable target
choices, adjacent field errors, private resumable drafts, and
full-screen or accessible inline presentation. It coordinates protected
state, image publication, temporary database provisioning, and the
existing serialized release. Failed builds can retry with a corrected
npm proxy; failed Terraform steps require a fresh plan and approval.
Operational-lock recovery and Hub shutdown each require explicit safety
checks and fresh consent.

Completion restores the shell and prints the service URL, immutable
image, saved configuration, and verified Azure resource links. Local
diagnostics omit answers, credentials, command output, and consent. The
welcome retains the GitHub Replica label. HTTP readiness does not verify
authorization; optional Hub sign-in still requires manual configuration.
No authentication setup or Hub product behavior changes here.

These final synthetic examples use the real Ink presentation components
with fabricated cloud data. They are design references, not deployment,
sign-in or recovery evidence. The receipt is split into two views so all
resource links and manual sign-in guidance remain visible.

![Welcome and cloud selection — synthetic — 112 columns × 38
rows](https://github.com/user-attachments/assets/c1a491ce-448a-482e-a896-42c7c0c3c810)

![Field validation error — synthetic — 112 columns × 38
rows](https://github.com/user-attachments/assets/2ac1f67d-3aee-4ada-a7e3-158cfa028a4e)

![Guarded Hub downtime consent — synthetic — 112 columns × 44
rows](https://github.com/user-attachments/assets/077205bd-b2d8-4fb5-80df-91c1e4ce0485)

![Separate operational lock-clearing consent — synthetic — 112 columns ×
44
rows](https://github.com/user-attachments/assets/ba25a404-214e-4b41-b4a2-5545e321aab3)

![Deployment receipt and primary resources — synthetic — 112 columns ×
36
rows](https://github.com/user-attachments/assets/3141cd06-ef24-4b22-bbc2-3c4c575dc13d)

![Remaining resource links and manual sign-in guidance — synthetic — 112
columns × 28
rows](https://github.com/user-attachments/assets/e3f70cec-634f-4360-85cd-8ddbc4795315)

A live Azure deployment and recovery exercise remain unverified; local
and synthetic evidence do not establish cloud behavior.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants